Body Rig. =================================== Body Metachain. ---------------- Body Metachain is a custom node that describes future body chain. Here is a simplified diagram of how a body rig works after it is built. .. image:: img/BodyRig_scheme.jpg Parent chain drives IK/FK component of child chain. IK/FK drives secondary controls, then secondary controls drive *npaCurveSolver* custom nodes or joints directly. Then, if chain has curveSolve node, curveSolve node drives grandchild chain. If it doesnt have curveSolve, secondary control drives grandchild chain. In npaBodyMetachain node we specify parents, children, how many joints it has, fk, ik, etc. So rig builder will later know how to process it. .. image:: img/metaChain_demo.gif .. raw:: html Attributes: **mtBuildStage** Shows on what build stage the chain is at the moment. -1 - Nothing done yet, 0 - Proxyes are placed, 1- Basic Rig, 2 - Rig features are added, 3 - Dynamics added. **mtSpline** Shows the rig builder if this chain should have spline features or not. More about mtSpline_. .. note:: At the moment, if you need twist functionality on chain, ou should check that. **mtIK / mtFK** Shows the rig builder if this chain should have IK / FK features or not. You can uncheck both, if you want. About mtIK_ / mtFK_. **mtRestParameters** If this chain has spline components, this attribute will store spline parameters of its joints. **mtAutoClavl** Will add autoclavicle solver. More about mtAutoClavl_. **mtSoftIK** Soft IK, antipop. More about mtSoftIK_. **mtFoot** Will add foot setup(reverse ik, footroll) to the leg. More about mtFoot_. **mtKneeLock** Will add knee lock. Knee/elbow/middle ik joint will stich to pole vector controller. More about mtKneeLock_. **mtReverseFK_** Adds reverse ik to the chain. Has to have FK checked. More about mtReverseFK_. **mtNumOfJoints** Number of joints chain has. If chain doesnt have spline this number should be equal to number of proxy parameters(mtProxyParameters) **mtParentChain** Specifies parent chain. Connects to mtChildrenChains of parent chain. **mtHelper** Connect triggered blendshape/helper here. More about mtHelper_. **mtMain(Position/Rotation/Scale)** Transform of chain proxyes root. In world space. **mtPoses** Poses of this chain that can be triggered(for grab pose of palm etc) More about mtPoses_ **mtProxyParameters** Parameters of proxy transforms. These show where secondary controls of chain will be. **mtChildrenChains** specify children chains. It connects here, because then rig will calculate where exactly to connect it. If chain has spline it will create a locator on spline and place it near this controller. **mtActive** shows the rig builder if we use this proxy or not. **mt(Position/rotation/Scale)** transform of this proxy. In object space of mtMain(*) **mtBendHere** If chain has FK/IK, chain will bend here, on this secondary controller. .. _BodyRigStart: Editing meta network. ------------------------ Every metanode should be connected to others via *"mtParentChain"* *"mtChildrenChains"* attributes all the way to the root *"nopiaRig_mtnt"*. Before you build anything, you can validate your metanetwork by pressing "Validate Scene for body rig" and "Graph Validation". Script will check how your nodes are connected and tell you if something is wrong. Usually. Building a bodyRig. --------------------- When your network is ready, you can start building it. First, on stage 1-2. .. image:: img/stage0-1_btns.jpg These settings are mostly for debugging. Unchecking these checkboxes allows user to isolate some build steps and see where build starts to go wrong. Or user can entirely disable some rig functionality if its not needed. **First textfield** Specifies which chains to rig. You can write them manually or by pressing "Pick BODY nts" **Second textfield** Maximum depth of rigging. **FreezeCtrl** Freezes transforms on proxy controls and creates offsets. More about FreezeCtrl_. **MotnControls** Replaces proxy controls with new motion controls, that will control curve solver or joints directly. More about MotnControls_. **ScaleRamp** Enables scaling on curve solver. More about ScaleRamp_ **InSlvSett** Instanciates chain settings under all crve solve controllers. More about InSlvSett_. **AddFKComp** Adds FK_ component. **AddIKComp** Adds IK_ component. **InstSwitch** Instanciates chain settings under IK/FK controls. More about InstSwitch_. **ConnctOld** `Connects old proxyes`_ with new for live updating proxy position in meta network **SymmCntrl** For `symmetrical behaviour`_. Useful when placing proxies. *Moved to stage 4* **Spread Joints Evenly** For joints attached to curve solve. Select a joint or a meta network and press to spread all joints evenly along curve. .. raw:: html .. raw:: html If you are making entirely new rig, then its better to build chains level by level and place them accordingly. You can build chains first without adding FK component(stage 2), placing proxyes, and then building stage 2. Then you can proceed to the next chain. In order to add a child chain to current one you current chain has to be on stage 2. Save your file, save a new version of it and try to rebuild it entirely how it is shown in next video. .. raw:: html If your rig was built without errors, then you can proceed to stage 3. .. note:: Features like Footroll_ and SkinProxy_ require extra steps to work. Stage 3 menus. .. image:: img/stage2_btns.jpg SinEnable_ Enables all sine waves on curve solve enabled chains. VolMaintain_ Volume preservation. PrmtrSwch_ Parametrization switch. SymmCntrl_ Symmetrical behaviour. AutoClavl_ Automatic clavicle solver. SoftIKhdl_ Soft Ik handle. KneeLock_ Knee lock. Locks Knee/elbow position in ik pole controller. SkinProxy_ Will skin your proxy meshes automatically. BendyPtch_ Bendy patch fixes the issue when first spline controller twists with fk/ik chain. This doesnt look very good on onganic characters. TwistPatch_ Curve solve handles twist itself, but only on joints and only between its controls, so this patch enables twist between "Non-Bend" spline controllers. FoootRolla_ Adds footroll, where its possible. TipOrient_ Mostly made for feet, so feet can aim to ik controls. OffsetEff_ Adds an offset controller on top of IK effector controller. ReverseFK_ Reverse FK behaviour. Good on spines. SetCntrls_ Sets positions of stored controls CV's. VisualizeFootrolls_ Creates a set of temporary joints, which you can use for placing footroll pivots before building a footroll. Adding a chain. (A) -------------------- 1. Duplicate other chain’s network. Add it to “metaData_ss” selection set 2. Rename it. 3. Connect plug “MtChildrenChains” of the parent chain to a new chain. 4. Edit network parameters in the attribute editor. 5. Build the rig. 6. Put your new chain in place as you did with proxies. 7. Wipe your scene and rebuild the rig. .. raw:: html Adding a chain. (B) ----------------------- 1. Duplicate other chain’s network. Add it to “metaData_ss” selection set 2. Rename it. 3. Connect plug “MtChildrenChains” of the parent chain to a new chain. 4. Edit network parameters in the attribute editor. 5. Build the rig(Stage 0). 6. Put your new chain in place as you did with proxies. 7. Build the rig(Stage 1). 8. If something is off, undo stage 1 and place proxies again. .. raw:: html Adding extra controls. ----------------------- 1. If you are adding a controller to the chain without a spline, change the number of joints accordingly. 2. Add a new item to MtProxyParameters. Check it as active, set the scale to (1, 1, 1) 3. Wipe the scene if a rig was already created for this chain. 4. Put the chain in place. .. raw:: html Skinning. ----------------------- After you've built all body rig stages, you should have your proxy mesh attached to skeleton. Refer to this_ part of documentation for more details on skinning proxy meshes. All Features build order and dependencies. --------------------------------------------- **Stage 1** Spline / Joint chain Set Proxy Positions **Stage 2** Freeze Controls Create Motion Controls. Create Scale Ramps. Instanciate Chain Settings. Add FK Component. Add IK Component. no FK or IK - Directly connect chain to parent. Instanciate switch. Connect Old Locators. ** Stage 3** *if Spline* Length Update. Sine enable. Volume preservation. Parametrization switch ( If SymmCtrl is off ) Auto Clavicle *if IK* Soft ik ( With or without knee lock and stretchy ) Bendy Patch. Twist Patch. *If Parent IK* Foot roll *if FK* Reversible FK ** Stage 4** Dynamics. In Detail. ------------------------ .. _FreezeCtrl: Freezing proxyes. ++++++++++++++++++++++++ Initially proxy transforms drive spline and you need to place them first. After moving em transforms are not freezed. This part of build freezed transform of those offsets and adds offsets to them. Also creates duplicates duplicates of those transforms to connect them back to metanode. .. raw:: html .. _MotnControls: Motion controls. ++++++++++++++++++++++++ These are controls that drive spline solver or joints directly. .. raw:: html .. _ScaleRamp: Scale Ramps. ++++++++++++++++++++++++ By default, scaling Motion controls wont affect anything. This part of build enables scaling. .. raw:: html .. _InSlvSett: .. _InstSwitch: Instantiation of chain settings. ++++++++++++++++++++++++++++++++++++++++++++++++ Chain settings are attributes on shape node. This shape node then is instantiated under every controller of that chain. .. raw:: html .. _mtFK: .. _FK: FK Component. ++++++++++++++++++++++++ FK attributes: **RFollow(Something)** Changes rotation space of this controller to selected one. **TFollow(Something)** Changes Position space of this controller to selected one. **RotateOrdr** Rotation order of selected controller. .. raw:: html .. _mtIK: .. _IK: IK Component. ++++++++++++++++++++++++ IK attributes: **Follow(Something)** Changes parent space of this controller to selected one. **AutoClavicle** Enables autoClavicle_ feature. **Stretch** Enables stretchy_ feature. **Max Stretch** Determines how much ik chain can stretch. **Soft IK** Enables softIK_ feature. .. raw:: html .. _mtSpline: Spline Component. ++++++++++++++++++++++++ Spline component is driven by **npaCurveSolve** custom node. Node Attributes: **In Parameters** .. _Active: **Active** Toggles corresponding CV on and off. **Active Twist** .. _ActiveTwist: Toggles twist interpolation on corresponding CV on and off. ( Doesnt work yet. Placeholder. ) **In Matrix** Matrix of controller that will drive spline. .. _BackActive: **Back Active** Toggles back tangent CV .. _BackTGWeight: **BackTgWgt** Weight of back tangent. Weight on 0.0 means that tangent will be oriented to InMatrix, 1.0 - to previous controller. .. _BackTgLength: **BackTgLength** Length of back tangent. Distance between main and tangent CVs. **Front Active** Toggles front tangent CV **FrontTgWgt** Weight of front tangent. Weight on 0.0 means that tangent will be oriented to InMatrix, 1.0 - to the next controller. **FrontTgLength** Length of front tangent. Distance between main and tangent CVs. **Scale Curve Ramp** This ramp describes how volume preservation will scale chain's joints. .. _ParameterRamp: **Parameter curve ramp** This ramp describes how the parameter is distributed along the curve. **Sine Curve Ramp** This ramp describes how position sine wave affects the chain. .. _SineMag: **Sine Mag** Position sine wave's magnitude(strength) .. _SineOff: **Sine Off** Position sine wave's offset(time) .. _SineFrq: **Sine Freq** Position sine wave's frequency **RSine Curve Ramp** This ramp describes how twist sine wave affects the chain. .. _RSineMag: **RSine Mag** Position sine wave's magnitude(strength) .. _RSineOff: **RSine Off** Position sine wave's offset(time) .. _RSineFrq: **RSine Freq** Position sine wave's frequency .. _RestLength: **Rest Length** This length node will consider as normal, when it is calculating volume preservation. .. _Shrink: **Shrink** On 0 chain wont shrink if spline length is less than *Rest Length*. The difference in length will be a straight line coming out of the last controller. .. _Stretch: **Stretch** On 0 chain joints wont stretch along a curve and stay in place as if spline has normal length. .. _UniformCurve: **Uniform curve** Curve parametrization switch. 1 - 0.0-1.0 along the curve. 0 - 0.0-1.0 Between Each CV. This node is driven by controllers. Controller's attributes used to drive *npaCurveSolve* node: .. image:: img/spline_attributes.jpg **TGL** Toggles this CV on and off. Connected to Active_ **TGL Twist** Toggles twist on this controller on and off. Connected to ActiveTwist_ **Back TG Len** Length of back tangent. Connected to BackTgLength_ **Back TG Aim** Aim Of back tangent. Connected to BackTGWeight_ **Back TG Tgl** Toggles back tangent. Connected to BackActive_ **Rest Len CRV** Rest length of main chain spline. Connected to RestLength_. **Uniform Crv** Switches between unoform and normal parametrization of spline. Connected to UniformCurve_ **Start P CRV** Connected to (0,0) of ParameterRamp_ **Mid P CRV** Connected to (0.5,0.5) of ParameterRamp_ **End P CRV** Connected to (1,1) of ParameterRamp_ **Stretch CRV** Connected to Stretch_ **Shrink CRV** Connected to Shrink_ **FK** Toggles FK_ Component of this chain on and off. Transforms to IK_FK parameter after finalization if chain has IK comonent. **Mag Pos Sin** Position sine wave magnitude. Connected to SineMag_ **Off Pos Sin** Offset sine wave magnitude. Connected to SineOff_ **Frq Pos Sin** Frequency sine wave magnitude. Connected to SineFrq_ **Mag Rot Sin** Position sine wave magnitude. Connected to RSineMag_ **Off Rot Sin** Offset sine wave magnitude. Connected to RSineOff_ **Frq Rot Sin** Frequency sine wave magnitude. Connected to RSineFrq_ .. raw:: html Direct joint component. ++++++++++++++++++++++++ This component drives joints directly with a constraint. .. raw:: html .. _Connects old proxyes: Connect old proxyes. ++++++++++++++++++++++++ Todo. .. _mtPoses: Body chain poses. ++++++++++++++++++++++++ Not fully implemented yet. .. _mtHelper: Correctives. ++++++++++++++++++++++++ Todo. .. _stretchy: Stretchy IK. ++++++++++++++++++++++++ .. raw:: html .. _symmetrical behaviour: .. _SymmCntrl: Symmetrical behaviour. ++++++++++++++++++++++++ To make the process of placing proxies easier, rig builder will connect transforms of left controllers to right side controllers. .. raw:: html If your chains have symmetrical names (e.g. l_leg_mtnt, r_leg_mtnt) rig will automatically place right chain symmetrically to left on building stage 2. So no need to place right side proxyes manually. .. raw:: html .. _SinEnable: Sine wave. ++++++++++++++++++++++++ .. raw:: html .. _VolMaintain: Volume preservaion. ++++++++++++++++++++++++ .. raw:: html .. _PrmtrSwch: Parametrization switch. ++++++++++++++++++++++++ .. raw:: html .. _mtAutoClavl: .. _AutoClavl: .. _autoClavicle: Automatic clavicle solver. ++++++++++++++++++++++++++++ .. raw:: html .. _SkinProxy: .. _this: Proxy Skin. ++++++++++++++++++++++++ If this option is checked rig will automatically find proxy meshes and skin em to skeleton. Also it tries to find exported skins and import them back. To set this up you need: 1. Setup proxies and main meshes rig should copy skin to. .. image:: img/Proxy_Naming.png Names of proxy meshes should look like this: "pm_{proxy_index}_{name}" Names of proxy meshes should look like this: "m_{proxy_index}_{index}_{name}" Proxy meshes will affect meshes with same {proxy_index}. {name}'s dont have to match You can rename meshes manually, or use automatic script by pressing "Set As proxy skin". First select proxy mesh, then select meshes it will affect and press that button. Script will create a group "proxy_geom" and put your proxy skin renamed there. .. raw:: html To skin proxyMeshes to skeleton check "SkinProxy" under stage2 of bodyRig tab. If builder can find exported skins under {Project}/Skins/"[%s]l%s_s%s_skinWeights.xml" % (mesh, skin_level, skin_stage) / [pm_0_body]lp_s0_skinWeights (*example name) To export proxy skins press "Export Proxy Skin" button under bodyRig tab. .. note:: This will export skins of all meshes under "proxy_geom" group .. raw:: html How to smooth proxy skin. System has automated script that will apply deltamush to your proxy skin and then bake it back to original skin. Here is how to use it: .. raw:: html .. _BendyPtch: Bendy Patch. ++++++++++++++++++++++++ Bendy patch fixes the fact that first bendy(spline) Control of chain moves with the first FK/IK controller. ON shoulder, for example, this should not happen. .. raw:: html .. _TwistPatch: Twist Patch. ++++++++++++++++++++++++ Temporary solution. Currently, twist interpolates only between neighbour controllers and TwstToggle attribute dosnt do anything. If, for example, you have 1 controller between elbow and shoulder twist wont spread all the way to elbow(or other way around). This patch fixes that. .. raw:: html .. _mtSoftIK: .. _SoftIKhdl: .. _softIK: Soft Ik. ++++++++++++++++++++++++ .. raw:: html .. _mtFoot: .. _Footroll: .. _FoootRolla: Foot Roll. ++++++++++++++++++++++++ In order to work, footroll needs footroll network. You create it by executing: bBuilder.create_footroll_network() .. raw:: html Or you can create it yourself. Its a simple network node with custom attributes. .. image:: img/Footroll_Node.png **Affected By** Connect it to bodyChain as it is shown on picture above. **Back** Position of back locator. In object space of tip IK controller. **BackCnd** Back condition. Used to calibrate footroll behaviour. **BackCnv** Back convertion. Multiplyes rotation by this number. Used to calibrate footroll behaviour. **Center** Position of back locator. In object space of tip IK controller. **CenterCnd** Center condition. Used to calibrate footroll behaviour. **CenterCnv** Center convertion. Multiplyes rotation by this number. Used to calibrate footroll behaviour. **Etc** Other are similar. Here are locator labels: .. image:: img/Footroll_Positions.png When your footroll network is connected you can check footroll in stage 3 build settings and create it. .. note:: when you first create footroll pivot locators will be off the places they need to be. You'll need to place them. .. _mtKneeLock: .. _KneeLock: Knee lock. ++++++++++++++++++++++++ .. raw:: html .. _OffsetEff: Offset Controller. ++++++++++++++++++++++++++++++++ Creates an extra controller under existing IK effector. .. image:: img/OffsetIkController.gif .. _ReverseFK: .. _mtReverseFK: Reversible FK. ++++++++++++++++++++++++ If this feature is enabled in build settings and in chain settings, FK chain will be able to reverse its hierarchy. .. raw:: html .. _SetCntrls: Controller shapes. ++++++++++++++++++++++++ Gets shapes of all your controllers from $PROJECT/rig_controls_data.json Doesn't do anything if this file does not exist. Shapes have to be Saved first by pressing "Store Controls CV's" Button. Shape is saved in object space of a controller. .. raw:: html .. _VisualizeFootrolls: Visualize Footrolls. +++++++++++++++++++++++++ .. image:: img/VisualizeFootrolls.gif .. _TipOrient: Tip Auto-Orientation. ++++++++++++++++++++++++ Adds aim constraint to footroll joints setup. Aims them to the next chain. .. note:: Works only with footroll now. It doen't have to be enabled or set up. Just needs to exist. .. image:: img/FootAim_Vectors.png .. raw:: html next_chain.get_controllers("fk")[-1]